Problem: $f(x) = \begin{cases} 2x-6 & \text{for} ~~~~x\gt{0} \\ -6e^x& \text{for} ~~~~ x \leq0\end{cases}$ Evaluate the definite integral. $\int^2_{-1}f(x)\,dx = $ Choose 1 answer: Choose 1 answer: (Choice A) A $14+6e^{2}$ (Choice B) B $\dfrac{10}{3} -6e^2$ (Choice C) C $-\dfrac{8}{3} +6e^2$ (Choice D) D $-14+6e^{-1}$
Explanation: Splitting up the definite integral Since we're working with a piecewise function, we need to split the definite integral up into two pieces: $\phantom{=} \int^2_{-1}f(x)\,dx$ $= \int^2_{0}f(x)\,dx + \int^{0}_{-1}f(x)\,dx~~~~~~$ [Why did we split at 0?] $= \int^2_{0}(2x-6)\,dx + \int^{0}_{-1}\left(-6e^x\right)\,dx ~~~~~~$ Evaluating each piece Next, let's evaluate each of these definite integrals one at a time. The first definite integral: $\begin{aligned} \int^2_{0}(2x-6)\,dx &=(x^2-6x)\Bigg|^2_{{0}} \\\\ &= \left[\left({2} \right)^2 - 6\cdot(2) \right] - \left[ \left({0} \right)^2 - 6\cdot(0)\right] \\\\ &= \left[-8\right] -\left[0 \right] \\\\ &= {-8}\end{aligned}$ The second definite integral: $\begin{aligned} \int^{0}_{-1}\left(-6e^x\right)\,dx &=-6e^x\Bigg|^0_{{-1}} \\\\ &= \left[-6e^{ 0} \right] - \left[-6e^{{-1}}\right] \\\\ &= \left[-6\right] -\left[-6e^{-1} \right] \\\\ &= {-6+6e^{-1}}\end{aligned}$ Putting the pieces together Now let's add these two pieces together to find the answer: $\phantom{=} \int^2_{0}(2x-6)\,dx + \int^{0}_{-1}\left(-6e^x\right)\,dx$ $ = {-8} + ({-6+6e^{-1}})$ $ = -14+6e^{-1}$ The answer $\int^2_{-1}f(x)\,dx = -14+6e^{-1}$